module AUDIO_PROCESS(
    input clk_60m,
    input rst_n,
    input signed [15:0] audio_r,
    input signed [15:0] audio_l,
    input signed [15:0] speaker_l,
    input signed [15:0] speaker_r,
    input data_async,
    input data_valid,
    input [10:0] pos_cnt,

    output signed [15:0] o_audio_r,
    output signed [15:0] o_audio_l,
    output tVAD
);
//1.双声道滤波器(时分复用*2)
wire signed [23:0] af_fir_l;
wire signed [23:0] af_fir_r;
FIR_APP fir_l_r_ins(
    .clk_60m(clk_60m),
    .rst_n(rst_n),
    .data_l(audio_l),
    .data_r(audio_r),
    .data_async(data_async),//48kHz脉冲,标识送数
    .data_valid(data_valid),

    .AF_data_l(af_fir_l),
    .AF_data_r(af_fir_r)
);

//2.AEC回声消除
//AEC_APP aec_ins(
//    .clk_60m(clk_60m),
//    .rst_n(rst_n),
//    .mic_l(audio_l),
//    .mic_r(audio_r),
//    .far_l(speaker_l),
//    .far_r(speaker_r),
//    .data_valid(data_async),//48kHz脉冲,标识送数
//    .AF_mic_l(o_audio_l),
//    .AF_mic_r(o_audio_r)
//);

//3.AGC自动增益
AGC_APP agc_ins(
    .clk_60m(clk_60m),
    .rst_n(rst_n),
    .data_l(af_fir_l),
    .data_r(af_fir_r),
    .pos_cnt(pos_cnt),

    .AF_data_l(o_audio_l),
    .AF_data_r(o_audio_r),
    .tVAD(tVAD)
);


endmodule